import request from '@/utils/request'

// 查询企业卡券订单明细列表
export function listCardOrderDetail(query) {
  return request({
    url: '/film/cardOrderDetail/list',
    method: 'get',
    params: query
  })
}

// 查询企业卡券订单明细详细
export function getCardOrderDetail(id) {
  return request({
    url: '/film/cardOrderDetail/' + id,
    method: 'get'
  })
}

// 新增企业卡券订单明细
export function addCardOrderDetail(data) {
  return request({
    url: '/film/cardOrderDetail',
    method: 'post',
    data: data
  })
}

// 修改企业卡券订单明细
export function updateCardOrderDetail(data) {
  return request({
    url: '/film/cardOrderDetail',
    method: 'put',
    data: data
  })
}

// 删除企业卡券订单明细
export function delCardOrderDetail(id) {
  return request({
    url: '/film/cardOrderDetail/' + id,
    method: 'delete'
  })
}


// 生成卡券
export function generate(data) {
  return request({
    url: '/film/cardOrderDetail/generate',
    method: 'post',
    data: data
  })
}
// 查询卡券信息
export function listCards(query) {
  return request({
    url: '/film/card/list',
    method: 'get',
    params: query
  })
}

// 查询卡券详细
export function cardIds(id) {
  return request({
    url: '/film/card/' + id,
    method: 'get'
  })
}

// 修改卡券信息
export function updatefilmCard(data) {
  return request({
    url: '/film/card',
    method: 'put',
    data: data
  })
}

// 查询卡使用记录列表

export function cardUsageRecordList(params) {
  return request({
    url: '/film/card/cardUsageRecordList',
    method: 'get',
    params
  })
}

// 根据订单号电影订单
export function cardorders(orderNo) {
  return request({
    url: '/film/card/order/' + orderNo,
    method: 'get'
  })
}

// 根据订单号电影订单
export function cardordersdetail(orderNo) {
  return request({
    url: '/film/card/order/detail/' + orderNo,
    method: 'get'
  })
}

// 卡券充值
export function recharge(data) {
  return request({
    url: '/film/card/recharge',
    method: 'post',
    data
  })
}
// 卡券充值
export function cardRechargeRecordList(params) {
  return request({
    url: '/film/card/cardRechargeRecordList',
    method: 'get',
    params
  })
}
// 延期时间的按钮
export function postpone(data) {
  return request({
    url: '/film/cardOrderDetail/postpone',
    method: 'put',
    data: data
  })
}